package leetcode;

import java.util.*;

public class DivingBoard {
    public int[] divingBoard(int shorter, int longer, int k) {
        if (k == 0) {
            return new int[0];
        }
        if (shorter == longer) {
            return new int[]{shorter * k};
        }
        int[] res = new int[k + 1];
        for (int i = k; i >= 0; i--) {
            res[i] = i * longer + (k - i) * shorter;
        }
        return res;
    }

    public static void main(String[] args) {
        DivingBoard divingBoard = new DivingBoard();
        System.out.println(Arrays.toString(divingBoard.divingBoard(1, 1, 100000)));
    }
}
